<a href='http://github.com/angular/angular.js/edit/master/docs/content/error/$injector/unpr.ngdoc' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this doc</a>


<h1>Error: $injector:unpr
  <div><span class='hint'>Unknown Provider</span></div>
</h1>

<div>
    <pre class="minerr-errmsg" error-display="Unknown provider: {0}">Unknown provider: {0}</pre>
</div>

<h2>Description</h2>
<div class="description">
  <p>This error results from the <code>$injector</code> being unable to resolve a required
dependency. To fix this, make sure the dependency is defined and spelled
correctly. For example:</p>
<pre><code>angular.module(&#39;myApp&#39;, [])
  .controller(&#39;MyController&#39;, [&#39;myService&#39;, function (myService) {
    // Do something with myService
  }]);</code></pre>
<p>The above code will fail with <code>$injector:unpr</code> if <code>myService</code> is not defined. </p>
<p>Making sure each dependency is defined will fix the problem, as noted below.</p>
<pre><code>angular.module(&#39;myApp&#39;, [])
  .service(&#39;myService&#39;, function () { /* ... */ })
  .controller(&#39;MyController&#39;, [&#39;myService&#39;, function (myService) {
    // Do something with myService
  }]);</code></pre>

</div>


